home *** CD-ROM | disk | FTP | other *** search
- #!/bin/sh
- # --------------------------------------------------------------------------
- # Copyright 1992 by Forschungszentrum Informatik (FZI)
- #
- # You can use and distribute this software under the terms of the licence
- # you should have received along with this program.
- # If not or if you want additional information, write to
- # Forschungszentrum Informatik, "STONE", Haid-und-Neu-Strasse 10-14,
- # D-7500 Karlsruhe 1, Germany.
- # --------------------------------------------------------------------------
- # 'sos-boot - 05:06:91 - Dietmar Theobald'
- #
- # sos-boot
- #
- # The SOS version is booted, i.e. its compiler is bootstrapped and the version
- # is (re-)generated using this compiler.
- #
- # The compiler bootstrap is done in several phases, each phase consists of
- # three steps:
- # - initializing the container directory,
- # - compiling all SOS schemas which are classified as boot schemas,
- # - generating a boot version of the version's compiler using the previously
- # generated schema files.
- # The last step is not performed if the generated schema files did not change
- # with respect to the previous phase. This signals also that the bootstrap of
- # a boot compiler is completed.
- #
- # The final phase consists of the complete generation of the version using the
- # previously generated boot compiler.
- #
- set -e
-
- phase='0'
- version="${SOSPATH-__SOS_INSTALLED_PATH__}"
- bootschemas="knl agg dir mta cci"
-
- SOSCONTAINER=$version/cnt ; export SOSCONTAINER
- SOSC_BOOTING='+' ; export SOSC_BOOTING
-
- cd $SOSCONTAINER
- rm -f *.sos
- for s in $bootschemas
- do
- ln -s $version/src/$s/${s}.sos
- done
-
- cd $version
- rm -f lib/*.o
- echo "--- PHASE $phase: make boot_compiler"
- make -r boot_compiler CPP_BOOT=-DBOOT
-
- while true
- do
- phase=`expr $phase + 1`
- cd $SOSCONTAINER
-
- echo "--- PHASE $phase: initialize" ; sos-init
-
- for s in $bootschemas
- do
- echo "--- PHASE $phase: compile $s" ; sos-cmp $s
- done
-
- differs=''
- for s in $bootschemas
- do
- s_differs=''
- for f in ${s}*.[ch]
- do
- /bin/cmp -s $f $version/src/$s/$f || { s_differs='+'
- mv -f $f $version/src/$s/$f
- }
- done
- [ "$s_differs" ] && { echo "--- PHASE $phase: schema $s differs"
- differs="$differs $s"
- }
- done
-
- cd $version/src
- for s in $differs
- do
- for f in $s/*.c
- do
- case "$f" in
- *_sos.c | *_scp.c) continue;;
- esac
-
- echo "--- PHASE $phase: sos-scp $f"
- sos-scp $s $version/src/$f
- done
- done
- [ "$differs" ] || break
-
- echo "--- PHASE $phase: make boot_compiler"
- cd $version
- make -r boot_compiler CPP_BOOT=-DBOOT
- done
-
- cd $SOSCONTAINER; rm -f *.sos *.[ch] *.out
-
- echo "--- PHASE 999: make all"
- cd $version
- rm -f `egrep -l BOOT src/*/*.c | sed -e 's|src/[^/]*/\([^ ]*\.\)c|lib/\1o|`
- make -r all
- rm -f bin/init
-